package org.lcb.demo.shiyan3.mapper;

import org.apache.ibatis.annotations.*;
import pojo.Cart;

import java.util.List;
@Mapper
public interface CartMapper {
    /*添加购物车的产品*/
    @Insert("INSERT INTO cart (product_id, quantity) VALUES (#{productId}, #{quantity}) ")
    void InsertProduct(int productId,int quantity);
    /*修改购物车产品的数量*/
    @Update("update cart set quantity=#{quantity} where product_id=#{productId}")
    void updateProductNum(int productId,int quantity);
    /*删除购物车中某个的产品*/
    @Delete("delete from cart where id=#{id}")
    void deleteCartById(int id);

    /*查找产品列表*/
    @Select("select * from cart")
    List<Cart> selectCartList();
}




